{include file="./public/header" title="用户组列表"/}
<link rel="stylesheet" type="text/css" href="__STATIC__/lib/datatables/css/dataTables.bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/lib/datatables-buttons/css/buttons.dataTables.min.css"/>
<link href="https://cdn.bootcss.com/bootstrap-validator/0.5.3/css/bootstrapValidator.min.css" rel="stylesheet">

<body class="hold-transition skin-blue fixed sidebar-mini">
<div class="wrapper">

    {include file="./public/navi"/}

    <!--页面主体-->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 后台</a></li>
                <li class="active">用户组列表</li>
            </ol>
        </section>
        <section class="content">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">用户组列表</h3>
                    <div class="box-tools">
                        <button onclick="javascript:location.reload();" type="button"
                                class="btn btn-box-tool"><i class="fa fa-refresh"></i> 刷新
                        </button>
                        <a href="create.html" type="button" class="btn btn-box-tool"><i
                                class="fa fa-plus"></i> 新增
                        </a>
                        <button id="edit-btn" type="button" class="btn btn-box-tool"><i
                                class="fa fa-pencil"></i> 修改
                        </button>
                        <button id="delete-btn" type="button" class="btn btn-box-tool"><i
                                class="fa fa-trash-o fa-fw"></i> 删除
                        </button>
                    </div>

                </div>
                <!-- /.panel-heading -->
                <div class="box-body table-responsive">
                    <table id="table" class="table table-condensed table-bordered">
                        <thead class="">
                        <tr>
                            <th class="text-center">ID</th>
                            <th class="text-center">用户组名称</th>
                            <th class="text-center">描述</th>
                            <th class="text-center">状态</th>
                            <th class="text-center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="groupLes" id="group"}
                        <tr>
                            <td align="center">{$group.id}</td>
                            <td align="center">{$group.title}</td>
                            <td align="center">{$group.remark}</td>
                            <td align="center">
                                <a href="javascript:void(0);" data-id="{$group.id}" data-field="status"
                                   data-value="{$group.status}" data-url="{:url('changeStatus', 'id='.$group['id'])}"
                                   class='changeStatus fa {if condition=" $group.status == 1 "}fa-check-circle text-green{else /}fa-times-circle text-red{/if}'>
                                </a>
                            </td>
                            <td align="center">
                                <a href="{:url('edit',array('id'=>$group['id']))}"
                                   class="btn btn-primary btn-xs">
                                    <i class="fa fa-pencil"></i> 编辑
                                </a>
                                <a href="{:url('assignRule',array('id'=>$group['id']))}"
                                   class="btn btn-success btn-xs">
                                    <i class="fa fa-lock"></i> 授权
                                </a>
                                <a href="javascript:if(confirm('确定删除？'))location='{:url('delete',array('id'=>$group['id']))}'"
                                   class="btn btn-danger btn-xs">
                                    <i class="fa fa-times"></i> 删除
                                </a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
                <!-- /.panel-body -->
            </div>
            <!-- /.panel -->
        </section>
    </div>
    <!-- /#page-wrapper -->

</div>
<!-- /#wrapper -->
<div class="modal fade" id="edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
                <h4 class="modal-title" id="myModalLabel"> 编辑用户组</h4></div>
            <form id="edit-form" class="form-inline" action="update.html" method="post">
                <input type="hidden" name="id">
                <table class="table table-striped table-hover table-condensed">
                    <tr>
                        <th width="20%">用户组名称：</th>
                        <td><input class="form-control" type="text" name="title"></td>
                    </tr>
                    <tr>
                        <th></th>
                        <td><input class="btn btn-success" type="submit" value="修改"></td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
{include file="public/js"/}
<script src="https://cdn.bootcss.com/bootstrap-validator/0.5.3/js/bootstrapValidator.min.js"></script>
<script src="__STATIC__/lib/datatables/js/jquery.dataTables.min.js"></script>
<script src="__STATIC__/lib/datatables/js/dataTables.bootstrap.min.js"></script>
<script src="__STATIC__/lib/datatables-buttons/js/dataTables.buttons.min.js"></script>
<script src="__STATIC__/lib/datatables-buttons/js/jszip.min.js"></script>
<script src="__STATIC__/lib/datatables-buttons/js/buttons.html5.min.js"></script>
<script src="__STATIC__/lib/datatables-buttons/js/buttons.print.min.js"></script>

<script>

</script>
</body>

</html>